function f = fit_lorentzian(lam,Data)
% fit function for single Boltzman fits
% calculates the value of the fitted function and returns
% the error vecor f
% to be used with leastsq etc.
% alpha=temperature factor (0.04 for 22 C)
% lam(1)=Gmx
% lam(2)=z
% lam(3)=V0.5

x = Data(:,1); 
y = Data(:,2);
g0 = lam(1);
fc = lam(2);

f=log10(y) - log10(g0./(1+(x/fc).^2));
%f=(y- g0./(1+(x/fc).^2))./y;
%[sum(f.^2) fc g0];
%f=y - g1./(1+(x./fc1).^2)+g2./(1+(x./fc2).^2);
